<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-CN">

    <head>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, shrink-to-fit=no, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>欢迎进入教务管理系统</title>

        <!-- Bootstrap Core CSS -->
        <link href="<%=request.getContextPath()%>/css/common_css/bootstrap_css/bootstrap.min.css" rel="stylesheet">

        <!-- Custom CSS -->
        <link href="<%=request.getContextPath()%>/css/common_css/sidebar_css/sidebar.css" rel="stylesheet">

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
            <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
        <script>
            function getinfo() {
                var atest=document.getElementById("txt").value
                var aset=document.getElementById("test")
                aset.setAttribute("href","SearchCourseName!searchCourseName?&keyword="+atest)
                aset.click()
            }
        </script>
    </head>

    <body>

        <div id="wrapper">

            <!-- Sidebar -->
            <div id="sidebar-wrapper">
                <ul class="sidebar-nav">

                    <!-- 标题 -->
                    <li class="sidebar-brand">
                        <a href="#">
                            教务管理系统
                        </a>
                    </li>

                    <!-- 排课子系统 -->
                    <li>
                    </li>

                    <!-- 毕设管理子系统 -->
                    <li>
                    </li>

                    <!-- 后台管理子系统 -->
                    <li>
                    </li>

                    <!-- 成绩查询子系统 -->
                    <li>
                    </li>

                    <!-- 选课子系统 -->
                    <li>
                    <a href="javascript:;" data-toggle="collapse" data-target="#selection">选课</a>
                            <ul id = "selection" class="collapse">

                            <li>
                                <a href="<%=request.getContextPath()%>/htmls/selection/statistics.jsp">信息统计</a>
                            </li>
                        </ul>

                    </li>

                    <!-- 注销 -->
                    <li>
                        <a href="<%=request.getContextPath()%>/login.jsp">注销</a>
                    </li>

                    <li>
                        <a href="#">关于本站</a>
                    </li>
                </ul>
            </div>
            <!-- /#sidebar-wrapper -->

            <!-- Page Content -->
            <div id="page-content-wrapper">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12">

                            <!--选课导航-->
                            <nav class="navbar navbar-default" role="navigation">
                                <div class="container-fluid">
                                    <div class="navbar-header">
                                        <a class="navbar-brand" href="#">统计信息</a>
                                    </div>
                                    <div>
                                        <div class="navbar-form navbar-right" role="search">
                                            <div class="form-group">
                                                <input id="txt" type="text" class="form-control" placeholder="输入课程名称">
                                            </div>
                                            <button id="sch" class="btn btn-default"  onclick="getinfo()">搜索</button><a href="#" id="test"></a>
                                            <a href="#menu-toggle" class="btn btn-default" id="menu-toggle">菜单</a>
                                        </>
                                    </div>
                                </div>
                            </nav>
                            <!---->
                            <!--课程信息-->
                            <div class="row clearfix">
                                <div class="col-md-12 column">
                                    <div class="table-responsive">
                                        <table class="table table-bordered table-condensed table-hover">
                                            <thead>
                                                <tr>
                                                    <th>课程编号</th>
                                                    <th>课程名称</th>
                                                    <th>授课教师</th>
                                                    <th>课程类型</th>
                                                    <th>已选人数</th>
                                                    <th>可选人数</th>
                                                    <th>详情</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            <s:iterator value="selectsitu">
                                                <tr>
                                                    <td><s:property value="courseid"></s:property> </td>
                                                    <td><a href="ShowDetailAction!showDetailCourse.action?courseid=${courseid}"><s:property value="coursename"></s:property> </a></td>
                                                    <td><s:property value="tname"></s:property> </td>
                                                    <td><s:property value="coursetype"></s:property> </td>
                                                    <td><s:property value="lnum"></s:property> </td>
                                                    <td><s:property value="cnum"></s:property> </td>
                                                    <td><a href="ShowDetailes!showDetails?courseid=${courseid}">详情</a></td>
                                                </tr>
                                            </s:iterator>
                                            </tbody>
                                        </table>
                                    </div>    
                                </div>
                            </div> 
                            <!---->
                            <!--底部导航-->
                            <div class="row clearfix">
                                <div class="col-lg-6 column">
                                    <nav style="text-align: left">
                                        <ul class="pagination">
                                            <li><a href="#">«</a></li>
                                            <li><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">»</a></li>
                                        </ul>
                                    </nav>  
                                </div>
                                <div class="col-lg-6 column">
                                    <div style="text-align: right">
                                        <button type="button" class="btn btn-default">返回</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /#page-content-wrapper -->
 b
        </div>
        <!-- /#wrapper -->

        <!-- jQuery -->
        <script src="<%=request.getContextPath()%>/js/common_js/jquery/jquery.min.js"></script>

        <!-- Bootstrap Core JavaScript -->
        <script src="<%=request.getContextPath()%>/js/common_js/bootstrap_js/bootstrap.min.js"></script>

        <!--这是按表格中关键字搜索的代码，我不确定有没有用-->
        <script>
            $(function(event){
                $("#sch").click(function(){
                    var stxt=$("#txt").val();
                    if($.trim(stxt)!=""){
                        $("table tbody tr").hide().filter(":contains('"+stxt+"')").show();
                    }else{
                        $("table tbody tr").show();
                    }
                });
            })
        </script>

        <!-- Menu Toggle Script -->
        <script>
        $("#menu-toggle").click(function(e) {
            e.preventDefault();
            $("#wrapper").toggleClass("toggled");
        });
        </script>
    </body>

</html>
